//
//  Rank_HotViewController.m
//  YLProject
//
//  Created by 王跃 on 2018/1/11.
//  Copyright © 2018年 WY. All rights reserved.
//

#import "Rank_HotViewController.h"
#import "Rank_PeopleInfoController.h"
#import "HotHeaderView.h"
#import "Rank_HotCell.h"
@interface Rank_HotViewController ()<HotHeaderViewProtocol>
//tableView头视图
@property(nonatomic,strong)HotHeaderView *headerView;
@end

@implementation Rank_HotViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([Rank_HotCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([Rank_HotCell class])];
    self.tableView.tableHeaderView = self.headerView;
    
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    Rank_HotCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([Rank_HotCell class])];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath{
    Rank_PeopleInfoController *rank_info = [[Rank_PeopleInfoController alloc]init];
    rank_info.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:rank_info animated:YES];
}
-(HotHeaderView *)headerView{
    if (!_headerView) {
        _headerView = [[HotHeaderView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width, 115)];
        _headerView.delegate = self;
        _headerView.backgroundColor = [UIColor whiteColor];
    }
    return _headerView;
}
- (void)hotHeaderViewClickTitles:(NSString *)title index:(NSInteger)index{
    NSLog(@"---%@",title);
}
- (void)hotHeaderViewClickMore:(NSInteger)index{
    [self.headerView setButton:@"更多"];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
